<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      date = [
        {
          date: "2019-05-20",
          count: 23,
        },
        {
          date: "2019-05-21",
          count: 19,
        },
        {
          date: "2019-05-22",
          count: 29,
        },
        {
          date: "2019-05-23",
          count: 24,
        },
      ];
      // 目标：将date数组转换成 ['2019-1-1','2019-1-2']
      // 解决方案：map方法
      // 数组.map(item=>item.你想要的数据)
      const arr = date.map((item) => item.date);
      console.log(arr);
    </script>
  </body>
</html>
